package com.syy.reducejoin;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;
import java.util.Iterator;

public class OrderJoinReducer extends Reducer<OrderJoin, NullWritable, OrderJoin, NullWritable> {
    @Override
    protected void reduce(OrderJoin key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        Iterator<NullWritable> iterator = values.iterator();
        iterator.next();
        String s = key.getpName();

        for (NullWritable a:values) {
            key.setpName(s);
            context.write(key, NullWritable.get());
        }

//        for (NullWritable a:values) {
//            System.out.println(key);
//        }
    }
}
